﻿@model List<WebBookmarkUI.Models.UIUserGroupInfo>
<script>
    var passGroupUserURL = "@Url.Action("PassGroupUser")";
    var rejectGroupUserURL ="@Url.Action("RejectGroupUser")";
</script>

<script src="~/DomainJS/showuserallgroupmessage.js"></script>
    <div class="admin-content">
    <div class="am-g">
        <div class="am-u-sm-12">
            <table class="am-table am-table-striped am-table-hover table-main ">
                <thead>
                    <tr>
                        <th class="table-id">序号</th>
                        <th class="table-main">群组名称</th>
                        <th class="table-date am-hide-sm-only">申请人</th>
                        <th class="table-set">申请时间</th>
                        <th class="table-set">当前状态</th>
                        <th class="table-set">操作</th>

                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.Count > 0)
                    {
                        int index = 1;
                        foreach (var userGroup in Model)
                        {
                            <tr>
                                <td>@index</td>
                                <td><a href='@Url.Content("~/GroupInfo/ShowGroupDetail?groupID=" + userGroup.GroupInfo.GroupInfoID)'>@userGroup.GroupInfo.GroupName</a> </td>
                              
                                <td>
                                    @if (userGroup.GroupUserInfo != null)
                                    {
                                        <a href='@Url.Content("~/UserInfo/ShowUserDetail?uid=" + userGroup.GroupUserInfo.UserInfoID)'>
                                            @userGroup.GroupUserInfo.UserName
                                        </a>
                                    }
                                </td>
                                <td>@userGroup.CreateTime</td>
                                <td>
                                    @if (userGroup.IsPass == 1)
                                    {
                                        <div class="am-text-success">
                                            <span class="am-icon-check">已通过</span>
                                        </div>
                                    }
                                    else if (userGroup.IsPass == 0)
                                    {
                                        <div class="am-text-danger">
                                            <span class="am-icon-bolt">等待审核</span>
                                        </div>
                                    }
                                    else if (userGroup.IsPass == 2)
                                    {
                                        <div class="am-text-danger"> <span class="am-icon-bolt">已被驳回</span></div>

                                    }
                                    else if (userGroup.IsPass == 3)
                                    {
                                        <div class="am-text-danger"> <span class="am-icon-bolt">已被移除</span></div>
                                    }
                                    else if (userGroup.IsPass == 4)
                                    {
                                        <div class="am-text-danger"> <span class="am-icon-times">已退出</span></div>
                                    }
                                </td>
                        
                                <td>
                                    <div>
                                        <a id="btnPass" data-id='@userGroup.GroupUserID'><span class="am-icon-check">通过</span></a>
                                        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                        <a id="btnReject" data-id='@userGroup.GroupUserID'><span class="am-icon-remove am-text-danger">驳回</span></a>
                                    </div>
                                </td>
                            </tr>
                                    index++;
                        }
                    }else
                    {
                         <tr><td colspan="6">暂无数据...</td></tr>
                    }
                </tbody>
            </table>

        </div>
    </div>
</div>



